<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改客户主数据')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-customer-edit" th:object="${customer}">
        <input id="id" name="id" type="hidden" th:field="*{id}"/>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">客户编码：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="code" id="code" th:field="*{code}" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">客户名称：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="name" id="name" th:field="*{name}" required>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-3 control-label">地址：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="address" id="address" th:field="*{address}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">联系邮箱：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="email" id="email" th:field="*{email}">
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-3 control-label">传真：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="fax" id="fax" th:field="*{fax}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="phone" id="phone" th:field="*{phone}">
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-3 control-label">邮政编码：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="postalCode" id="postalCode"
                           th:field="*{postalCode}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">国家：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="country" id="country" th:field="*{country}">
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-3 control-label">城市：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="city" id="city" th:field="*{city}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">联系人：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="contact" id="contact" th:field="*{contact}">
                </div>
            </div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">客户类型：</label>
				<div class="col-sm-8">
					<select id="type" name="type" class="form-control"
							th:with="type=${@dict.getType('customer_type')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
								th:field="*{type}"></option>
					</select>
				</div>
			</div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-3 control-label">优先级：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="priority" id="priority" th:field="*{priority}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">信用：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="credit" id="credit" th:field="*{credit}">
                </div>
            </div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">客户状态：</label>
				<div class="col-sm-8">
					<select name="status" class="form-control"
							th:with="type=${@dict.getType('sys_normal_disable')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
								th:field="*{status}"></option>
					</select>
				</div>
			</div>
        </div>
		<h4 class="form-header h4">其他信息</h4>
		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-xs-3 control-label">备注：</label>
					<div class="col-xs-8">
						<textarea id="remark" name="remark" maxlength="500" class="form-control" rows="3" >[[*{remark}]]</textarea>
					</div>
				</div>
			</div>
		</div>
    </form>
</div>

<div class="row">
	<div class="col-sm-offset-5 col-sm-10">
		<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
		<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
	</div>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "system/customer";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-customer-edit').serialize());
        }
    }
</script>
</body>
</html>
